﻿Public Class F12_M

    Private Sub btnguardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnguardar.Click
        If (Len(txtnumform.Text) = 0) Then
            MsgBox("EL Número de formulario es un campo obligatorio", MsgBoxStyle.Exclamation)
            txtnumform.Focus()
            Exit Sub
        End If
        Dim oF12MNegocios As New Negocios.NF12_M
        Dim oF12M As New Entidades.EF12MotoVehiculos
        oF12M.numformu = UCase(txtnumform.Text)
        oF12M.dominioo = UCase(txtdominio.Text)
        oF12M.marcaa = UCase(txtmarca.Text)
        oF12M.tipoo = UCase(txttipo.Text)
        oF12M.modeloo = UCase(txtmodelo.Text)
        oF12M.marcamotorr = UCase(txtmarcamotor.Text)
        oF12M.nummotorr = UCase(txtnummotor.Text)
        oF12M.marcacuadroo = UCase(txtmarcacuadro.Text)
        oF12M.numcuadroo = UCase(txtnumcuadro.Text)
        oF12M.observacioness = UCase(txtobservaciones.Text)
        oF12M.lugarr = UCase(txtlugar.Text)
        oF12M.diaa = UCase(txtdia.Text)
        oF12M.mess = UCase(txtmes.Text)
        oF12M.añoo = UCase(txtaño.Text)
        oF12M.apenomm = UCase(txtapenom.Text)
        oF12M.documentoo = UCase(txtdocumento.Text)
        oF12M.callee = UCase(txtaño.Text)
        oF12M.numm = UCase(txtnum.Text)
        oF12M.localidadd = UCase(txtlocalidad.Text)
        

        Try
            If oF12MNegocios.guardarF12M(oF12M) Then
                MsgBox("La carga ha sido exitosa", MsgBoxStyle.MsgBoxSetForeground, "Información")
            End If
        Catch ex As Exception
            MsgBox("Carga fallida. " + ex.Message, MsgBoxStyle.MsgBoxSetForeground, "Información")
        End Try
    End Sub

    Private Sub btnEditarAnverso_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEditarAnverso.Click
        If (Len(txtnumform.Text) = 0) Then
            MsgBox("EL Número de formulario es un campo obligatorio", MsgBoxStyle.Exclamation)
            txtnumform.Focus()
            Exit Sub
        End If
        Dim oF12MNegocios As New Negocios.NF12_M
        Dim oF12M As New Entidades.EF12MotoVehiculos
        oF12M.numformu = UCase(txtnumform.Text)
        oF12M.dominioo = UCase(txtdominio.Text)
        oF12M.marcaa = UCase(txtmarca.Text)
        oF12M.tipoo = UCase(txttipo.Text)
        oF12M.modeloo = UCase(txtmodelo.Text)
        oF12M.marcamotorr = UCase(txtmarcamotor.Text)
        oF12M.nummotorr = UCase(txtnummotor.Text)
        oF12M.marcacuadroo = UCase(txtmarcacuadro.Text)
        oF12M.numcuadroo = UCase(txtnumcuadro.Text)
        oF12M.observacioness = UCase(txtobservaciones.Text)
        oF12M.lugarr = UCase(txtlugar.Text)
        oF12M.diaa = UCase(txtdia.Text)
        oF12M.mess = UCase(txtmes.Text)
        oF12M.añoo = UCase(txtaño.Text)
        oF12M.apenomm = UCase(txtapenom.Text)
        oF12M.documentoo = UCase(txtdocumento.Text)
        oF12M.callee = UCase(txtaño.Text)
        oF12M.numm = UCase(txtnum.Text)
        oF12M.localidadd = UCase(txtlocalidad.Text)


        Try
            If oF12MNegocios.editarF12M(oF12M) Then
                MsgBox("La Edición ha sido exitosa", MsgBoxStyle.MsgBoxSetForeground, "Información")
            End If
        Catch ex As Exception
            MsgBox("Edición fallida. " + ex.Message, MsgBoxStyle.MsgBoxSetForeground, "Información")
        End Try
    End Sub

    Private Sub btnNuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNuevo.Click
        txtnumform.Text = ""
        txtdominio.Text = ""
        txtmarca.Text = ""
        txttipo.Text = ""
        txtmodelo.Text = ""
        txtmarcamotor.Text = ""
        txtnummotor.Text = ""
        txtmarcacuadro.Text = ""
        txtnumcuadro.Text = ""
        txtobservaciones.Text = ""
        txtlugar.Text = ""
        txtdia.Text = ""
        txtmes.Text = ""
        txtaño.Text = ""
        txtapenom.Text = ""
        txtdocumento.Text = ""
        txtcalle.Text = ""
        txtnum.Text = ""
        txtlocalidad.Text = ""


    End Sub

    Private Sub btnsalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsalir.Click
        Me.Close()
    End Sub

    Private Sub btnF01V_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF01V.Click
        F01_V_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF01M_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF01M.Click
        F01_M_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF01I_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF01I.Click
        F01_VImp_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF02V_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF02V.Click
        F02_V_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF02M_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF02M.Click
        F02_M_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF04V_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF04V.Click
        F04_V_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click
        F04_M_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF08V_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF08V.Click
        F08_V_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF08M_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF08M.Click
        F08_M_anverso_.Show()
        Me.Close()
    End Sub

    Private Sub btnF11V_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF11V.Click
        F11_V_anverso_.Show()
        Me.Close()

    End Sub

    Private Sub btnF11M_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF11M.Click
        F11_M_anverso_.Show()
        Me.Close()

    End Sub

    Private Sub btnF12V_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF12V.Click
        F12_V.Show()
        Me.Close()
    End Sub

    Private Sub btnF99_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF99.Click
        F99.Show()
        Me.Close()
    End Sub

    Private Sub btnF59M_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnF59M.Click
        F59_M.Show()
        Me.Close()
    End Sub

    Private Sub btnFR00_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFR00.Click
        F_R00.Show()
        Me.Close()
    End Sub

    Private Sub btnReverso_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReverso.Click
        MsgBox("El presente formulario no posee lado Reverso", MsgBoxStyle.DefaultButton1, Title:="INFORMACIÓN")
    End Sub
End Class
